package com.xrui.hbase.util;

import java.util.Comparator;

/**
 * A comparator that sorts Longs in reverse chronological order.
 */
public final class TimestampComparator implements Comparator<Long> {
    /** A singleton instance. */
    public static final TimestampComparator INSTANCE = new TimestampComparator();

    /** Use TimestampComparator.INSTANCE instead. */
    private TimestampComparator() {}

    @Override
    public int compare(Long left, Long right) {
        return right.compareTo(left);
    }
}
